home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cenvid9.zip / ERRLEV.BAT < prev    next >
DOS Batch File  |  1994-03-04  |  887b  |  18 lines

  1. @echo off
  2. REM ************************************************************************
  3. REM *** ERRLEV.BAT - Call a program, passing up to 8 parameters, and     ***
  4. REM *** ver.1        set the ERRLEV environment variable from the return ***
  5. REM ***              Code of that program. Also return with ERRORLEVEL   ***
  6. REM ***              set as if the program was run directly from the     ***
  7. REM ***              command prompt or from a batch file.                ***
  8. REM ************************************************************************
  9.  
  10. if not "%1" == "" GOTO RUN_ERRLEV
  11.  
  12. ECHO ERRLEV - Call a program, passing up to 8 paramters. Sets ERRLEV environment
  13. ECHO          variable to the value returned. Also set ERRORLEVEL for batch file.
  14. ECHO          Example: ERRLEV CHKDSK C:
  15.  
  16. :RUN_ERRLEV
  17. CEnvi return(ERRLEV = spawn(P_WAIT,`%1 %2 %3 %4 %5 %6 %7 %8 %9`));
  18.